var should = require('should');
var config = require('../../config');
var checkHandler = require('../../../app/servers/activity/handler/checkHandler');
var checkModel = require('../../../app/models/checkModel');
var configUtil = require('../../../app/util/configUtil');
var analyze = require('kc-analyze');

suite('测试checkHandler', function () {
    setup(function (done) {
        var analyze_config = configUtil.load('analyze');
        var game_config = configUtil.load('game');
        analyze.initialize({
            host: analyze_config.host,
            server_id: game_config.server_id
        });

        checkModel.getByRoleId(config.role_id, function (err, check_model) {
            // check_model.resetCheckInfo();
            // check_model.deny_check_day = 20;
            check_model.toJSON();
            check_model.save(done);
        });
        //done();
    });

    suite('sign', function () {
        test('测试签到1', function (done) {
            var msg = {};
            var session = {};
            session.uid = config.role_id;
            var check_handler = new checkHandler();
            check_handler.sign(msg, session, function (err, res) {
                done();
            });
        });
    });

    // suite('retry', function () {
    //     test('测试补签到2', function (done) {
    //         var msg = {};
    //         var session = {};
    //         session.uid = config.role_id;
    //         var check_handler = new checkHandler();
    //         check_handler.retry(msg, session, function (err, res) {
    //             done();
    //         });
    //     });
    // });

    // suite('retry', function () {
    //     test('测试补签到3', function (done) {
    //         var msg = {};
    //         var session = {};
    //         session.uid = config.role_id;
    //         var check_handler = new checkHandler();
    //         check_handler.retry(msg, session, function (err, res) {
    //             done();
    //         });
    //     });
    // });
});
